package com.smfx.yxt.common.enums;

public enum Week {

	D1(1, "星期一"),
	D2(2, "星期二"),
	D3(3, "星期三"),
	D4(4, "星期四"),
	D5(5, "星期五"),
	D6(6, "星期六"),
	D7(7, "星期日")
	;
	
	private final Integer key;
	
	private final String value;
	
	private Week(Integer key, String value) {
		this.key = key;
		this.value = value;
	}
	
	public static Integer getKey(String v) {
		for(Week type : Week.values()) {
			if(type.getValue().equals(v)) {
				return type.getKey();
			}
		}
		return null;
	}

	public static String getValue(Integer k) {
		for(Week type : Week.values()) {
			if(type.getKey().intValue() == k.intValue()) {
				return type.getValue();
			}
		}
		return null;
	}
	
	public Integer getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}
	
}
